package com.interagriculture.controller;

import com.interagriculture.common.PageResult;
import com.interagriculture.common.Result;
import com.interagriculture.entity.Project;
import com.interagriculture.entity.query.ProjectQuery;
import com.interagriculture.service.ProjectService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (Project)表控制层
 *
 * @author makejava
 * @since 2024-10-24 19:13:41
 */
@RestController
@RequestMapping("/project")
public class ProjectController {
    /**
     * 服务对象
     */
    @Resource
    private ProjectService projectService;

    /**
     * 显示项目
     * @param projectQuery
     * @return
     */
    @GetMapping("/getOurProjects")
    public Result<PageResult> getOurProjects(@RequestBody(required = false)ProjectQuery projectQuery){
        PageResult pageResult = projectService.findByPage(projectQuery);
        return Result.ok(pageResult);
    }


}

